package com.example.home.attorney;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.fragment.app.Fragment;

import com.bumptech.glide.Glide;
import com.example.home.R;
import com.example.home.attorney.bean.HotAttorneyBean;

import static com.example.home.tool.StaticActi.ip;


public class ServiceModeFragment extends Fragment {

    private HotAttorneyBean.DataBean rows;
    private ImageView imgUrl;
    private TextView baseInfo;
    private TextView workStartAt;
    private TextView licenseNo;
    private TextView eduInfo;
    private View view;

    public ServiceModeFragment(HotAttorneyBean.DataBean rows) {
        this.rows = rows;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_service_mode, container, false);

        initView();
        getData();


        return view;
    }

    private void getData() {
        Glide.with(getActivity()).load(ip+rows.getAvatarUrl()).into(imgUrl);
        baseInfo.setText("律师介绍:"+rows.getBaseInfo());
        workStartAt.setText("执业年限:"+rows.getWorkStartAt());
        licenseNo.setText("执业编号:"+rows.getLicenseNo());
        eduInfo.setText("律师介绍:"+rows.getEduInfo());
    }

    private void initView() {

        imgUrl = view.findViewById(R.id.imgUrl);
        baseInfo = view.findViewById(R.id.baseInfo);
        workStartAt = view.findViewById(R.id.workStartAt);
        licenseNo = view.findViewById(R.id.licenseNo);
        eduInfo = view.findViewById(R.id.eduInfo);

    }
}